# 基础数据类型注解
import json
import random

var_1: int = 10
var_2: str = "China"
var_3: bool = True


# 类对象类型注解
class Student:
    pass


stu: Student = Student()

# 基础容器类型注解
my_list: list = [1, 2, 3]
my_tuple: tuple = (1, 2, 3)

# 容器类型详细注解
my_list = [1, 2, 3]         # type: int
my_tuple = (1, "China", False)  # type: int, str, bool

# 在注解中进行类型注解
var_4 = random.randint(1, 10)       # type: int
var_5 = json.load('{"name": "zhangsan"}')     # type:dict[str, str]
def func():
    return 10


var_3 = func()      # type: int

# 类型注解的限制
